package com.ronan.common.response;


/**
 * 响应枚举
 *
 * @author ronan
 * @date 2021/02/25
 */
public enum ResultCode {
    SUCCESS(200, "OK"),
    FAIL(500, "服务器繁忙，请稍后再试"),
    FAIL_PARAM(3000, "参数异常"),
    FAIL_PARAM_NULL(3001, "参数为空"),
    FAIL_PARAM_INVALID(3002, "参数无效"),
    FAIL_PARAM_TYPE_INVALID(3003, "参数类型有误"),
    FAIL_BIZ(4000, "业务异常"),
    FAIL_SIGN(4001, "解密无效，参数有误"),
    FAIL_DECODE(4002, "解密无效，参数有误"),
    FAIL_ENCRYPT(4003, "加密响应异常，参数有误"),
    FAIL_SYS(5000, "系统异常，请稍后再试"),
    FAIL_RPC(5001, "服务调用失败，请稍后再试"),
    FAIL_UMS(6000, "用户异常"),
    FAIL_UMS_NOT_LOGIN(6001, "未登录，请重新登录", "Not logged in, please login again");

    private final Integer code;
    private final String msg;
    private String enUsMsg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    ResultCode(Integer code, String msg, String enUsMsg) {
        this.code = code;
        this.msg = msg;
        this.enUsMsg = enUsMsg;
    }

    ResultCode getValue(Integer code) {
        ResultCode[] var2 = values();
        int var3 = var2.length;

        for (int var4 = 0; var4 < var3; ++var4) {
            ResultCode resultCodeEnum = var2[var4];
            if (resultCodeEnum.code.equals(code)) {
                return resultCodeEnum;
            }
        }

        return null;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getEnUsMsg() {
        return this.getEnUsMsg();
    }
}
